home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / mc51bugs / q31560 < prev    next >
Text File  |  1988-07-20  |  2KB  |  85 lines

  1. Q31560 Internal Compiler Error: grammar.c, Line 91
  2. C Compiler
  3. 5.10
  4. MS-DOS
  5.  
  6. Summary:
  7.    When the following program is compiled with the compile option
  8. /Alhu, it will generate the following error:
  9.  
  10.      fatal error C1001: Internal Compiler Error
  11.      (compiler file '@(#)grammar.c , line 91)
  12.         Contact Microsoft Technical Support
  13.  
  14.    To work around the problem, break up the assignment statements, as
  15. shown in the modified code below.
  16.    Microsoft is researching this problem and will post new information
  17. as it becomes available.
  18.  
  19. More Information:
  20.    The following program demonstrates the problem:
  21.  
  22. # define SWAPLONG(p) \
  23.  (long) (  ((*(((int *)(p)) ) << 24) & 0xff000000)     \
  24.         | ((*(((int *)(p)) + 1) << 16) & 0x00ff0000)   \
  25.         | ((*(((int *)(p)) + 2) << 8) & 0x0000ff00)    \
  26.         |  (*(((int *)(p)) + 3) & 0x000000ff) )
  27.  
  28. typedef struct extent
  29. {
  30.         long    ex_next;
  31.         long    ex_prev;
  32.         long    ex_objid;
  33. } EXTENT;
  34.  
  35. main()
  36. {
  37.    register EXTENT *extent, *oextent;
  38.    register int    i;
  39.  
  40.    extent->ex_next=SWAPLONG(&oextent->ex_next);
  41.    extent->ex_prev=SWAPLONG(&oextent->ex_prev);
  42.    extent->ex_objid=SWAPLONG(&oextent->ex_objid);
  43.  
  44. }
  45.  
  46.    The following is one way to modify the above code to work around
  47. the internal compiler error:
  48.  
  49. # define SWAPLONG(p) \
  50.  (long) (  ((*(((int *)(p)) ) << 24) & 0xff000000)     \
  51.         | ((*(((int *)(p)) + 1) << 16) & 0x00ff0000)   \
  52.         | ((*(((int *)(p)) + 2) << 8) & 0x0000ff00)    \
  53.         |  (*(((int *)(p)) + 3) & 0x000000ff) )
  54.  
  55. typedef struct extent
  56. {
  57.         long    ex_next;
  58.         long    ex_prev;
  59.         long    ex_objid;
  60. } EXTENT;
  61.  
  62. main()
  63. {
  64.     register EXTENT *extent, *oextent;
  65.     register int    i;
  66.     long l,k;
  67.  
  68.     l=SWAPLONG(&oextent->ex_next);
  69.     extent->ex_next=l;
  70.  
  71.     k=oextent->ex_prev;
  72.     l = SWAPLONG(&k);
  73.     extent->ex_prev = l;
  74.  
  75.     k=oextent->ex_objid;
  76.     l = SWAPLONG(&k);
  77.     extent->ex_objid = l;
  78.  
  79. }
  80.  
  81.  
  82.  
  83. Keywords:  buglist5.10
  84. Updated  88/07/21 03:19
  85.